package cn.yunhe.action;

import java.io.IOException;
import java.io.PrintWriter;

public class UserPremitAction extends BaseAction {
	private String uid;
	private String pwd;
	
	
	public String checklogin () {
		if ("admin".equals(uid)&&"admin".equals(pwd)||"scott".equals(uid)&&"tiger".equals(pwd)) {
			getMapSession().put("role", uid);
			return SUCCESS;
		}else {
			getMapRequest().put("msg", "用户名或密码错误，请重新登录<a href='login.jsp'>登录</a>");
			return ERROR;
		}
	}
	
	public String addUser() {
		PrintWriter out=null;
		try {
			out=getResponse().getWriter();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		out.println("正在进行用户添加（addUser）");
		return null;
	}
	
	public String getUid() {
		return uid;
	}
	public void setUid(String uid) {
		this.uid = uid;
	}
	public String getPwd() {
		return pwd;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	
}
